Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading the fabric components #4863

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Vishva066
Copy link

Type of change

  • Improvement (improvement to code, performance, etc)

Description

I was trying to upgrade the chaincode version from v2.2 to v2.5.4 so I went to the documentation and tried to do the steps mentioned in the documentation. When I tried with those commands I faced different errors. The errors I encountered are couldn't run the orderer container as the orderer was looking for certificates which was not backed up. The opt path in the docker container has no files in it. Instead we have to backup from var directory which includes both the orderer and production folders. In the peer container we have to mention the name of the fabric network for the chaincode container to start otherwise the chaincode container is not starting. So I fixed all the errors and made a new documentation for upgrading the fabric components and upgrading the capabilities.

Additional details

Added upgrading steps for couchdb and fabric-ca also.

Related issues

#4862

@Vishva066 Vishva066 requested review from a team as code owners May 17, 2024 16:36
@C0rWin
Copy link
Contributor

C0rWin commented May 21, 2024

@Vishva066, Thanks for your contribution. Could you please sign off on your commitment to making DCO checks happy?

Comment on lines +135 to +142
To get the approval of the peer use this command.

```
peer channel signconfigtx -f channel-artifacts/config_update_in_envelope.pb
```

Do this command for all the majority of the peer organizations

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This addition breaks up the prior and next paragraphs which were meant to run together.

Also, we try not to repeat doc content in various places. The signature gathering for channel updates is documented here:
https://hyperledger-fabric.readthedocs.io/en/latest/channel_update_tutorial.html#sign-and-submit-the-config-update

I'd suggest to refer to the channel update tutorial instead of re-documenting it here.

@@ -111,8 +120,11 @@ docker stop $ORDERER_CONTAINER

Once the orderer is down, you'll want to **backup its ledger and MSP**:

Copying the orderer and production folder because the orderer checks for the certificate in the orderer folder only that is the reason we are copying the orderer and production folder.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm ok with the below update to copy all the /var/hyperledger content, but I'd remove the sentence above because it is confusing and doesn't add much value.

docker cp $ORDERER_CONTAINER:/var/hyperledger/production/orderer/ ./$LEDGERS_BACKUP/$ORDERER_CONTAINER
docker cp $ORDERER_CONTAINER:/var/hyperledger/ ./$LEDGERS_BACKUP/$ORDERER_CONTAINER

docker cp $ORDERER_CONTAINER:/etc/hyperledger/fabric ./$LEDGERS_BACKUP/Identity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using test-network I don't think the identity is stored in /etc/hyperledger/fabric.
Which identity files are you talking about?
Can you provide a link to the fabric-samples/test-network reference that you are talking about?

--env-file ./env<name of node>.list \
--name $ORDERER_CONTAINER \
hyperledger/fabric-orderer:$IMAGE_TAG orderer
docker run -d -v ./backup/$ORDERER_CONTAINER/:/var/hyperledger/ -v ./backup/Identity:/etc/hyperledger/fabric/ --env-file ./envorderer.list --name $ORDERER_NAME -p 7050:7050 -p 7053:7053 -p 9443:9443 --network fabric_test hyperledger/fabric-orderer:$IMAGE_TAG orderer
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the line formatting.

@@ -167,6 +175,8 @@ We can then **backup the peer’s ledger and MSP**:

```
docker cp $PEER_CONTAINER:/var/hyperledger/production ./$LEDGERS_BACKUP/$PEER_CONTAINER

docker cp $PEER_CONTAINER:/etc/hyperledger/fabric/ ./$LEDGERS_BACKUP/Identity
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, which identity files?


```

Likewise do this for other organizations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Likewise do this for other organizations
Follow similar steps for the remaining CAs.

Comment on lines +220 to +222
(OR)

You can also follow these steps:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(OR)
You can also follow these steps:
Here is a sample for orderer organization CA backup and upgrade.

@@ -226,6 +274,50 @@ To upgrade CouchDB:
3. Install the latest CouchDB binaries or update deployment scripts to use a new Docker image.
4. Restart CouchDB.

Follow these steps to upgrade the couchdb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should listed as an option in the "Upgrade the peers" section above.

```
mkdir couchdb0_backup

export LEDGERS_BACKUP=couchdb0_backup
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use a more appropriate name.

Run the couchdb with upgraded docker version

```
docker run -d -v ./$LEDGERS_BACKUP/data/:/opt/couchdb/data/ --env-file ./couchdb0_backup.list --name $COUCHDB0_NAME -p 5984:5984 --network fabric_test couchdb:3.3.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
docker run -d -v ./$LEDGERS_BACKUP/data/:/opt/couchdb/data/ --env-file ./couchdb0_backup.list --name $COUCHDB0_NAME -p 5984:5984 --network fabric_test couchdb:3.3.2
docker run -d -v ./$LEDGERS_BACKUP/data/:/opt/couchdb/data/ --env-file ./couchdb0_backup.list --name $COUCHDB0_NAME -p 5984:5984 --network fabric_test couchdb:3.3.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants